package com.rentplant.controller;

import com.alibaba.fastjson.JSONObject;
import com.rentplant.Pojo.helpinfojudge;
import com.rentplant.service.impl.helpInfoJudgeServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController//让它知道这是controller
@RequestMapping("/helpInfoJudge")
public class helpInfoJudgeController {
    @Autowired
    private helpInfoJudgeServiceImp helpinfojudgeserviceimp;

    @RequestMapping("/selectJudgeById")
    //按照求租信息id进行查找评论
    public List<helpinfojudge> selectJudgeById(@RequestBody JSONObject req){
        try {
            return helpinfojudgeserviceimp.selectJudgeById(req);
        }catch (Exception e){
            throw  new RuntimeException(e);
        }

    }

    //添加求助信息评论
    @RequestMapping("/addHelpJudgeInfo")
    public boolean addHelpJudgeInfo(@RequestBody JSONObject req){
        try {
            return helpinfojudgeserviceimp.addHelpJudgeInfo(req);
        }catch (Exception e){
            throw  new RuntimeException(e);
        }
    }

}
